import { S } from '../../s';
import { IPSMDAjaxControlHandler } from './ipsmdajax-control-handler';
import { PSAjaxControlHandlerImpl } from './psajax-control-handler-impl';
import { IPSSysUserDR } from '../../security/ipssys-user-dr';

export class PSMDAjaxControlHandlerImpl
  extends PSAjaxControlHandlerImpl
  implements IPSMDAjaxControlHandler
{
  get customDRMode2Param(): string {
    return this.M.customDRMode2Param;
  }

  get customDRModeParam(): string {
    return this.M.customDRModeParam;
  }

  get fetchTimeout(): number {
    return this.M.fetchTimeout != null ? this.M.fetchTimeout : -1;
  }

  get orgDR(): 1 | 2 | 4 | 8 {
    return this.M.orgDR != null ? this.M.orgDR : 0;
  }

  protected pssysuserdr: IPSSysUserDR;
  getPSSysUserDR(): IPSSysUserDR | null {
    return (
      this.pssysuserdr ||
      (this.pssysuserdr = this.fillObjectModel(
        S._285,
        this.M.getPSSysUserDR,
        S._2e0,
      ) as IPSSysUserDR)
    );
  }

  protected pssysuserdr2: IPSSysUserDR;
  getPSSysUserDR2(): IPSSysUserDR | null {
    return (
      this.pssysuserdr2 ||
      (this.pssysuserdr2 = this.fillObjectModel(
        S._285,
        this.M.getPSSysUserDR2,
        S._2e1,
      ) as IPSSysUserDR)
    );
  }

  get secBC(): string {
    return this.M.secBC;
  }

  get secDR(): 1 | 2 | 4 | 8 {
    return this.M.secDR != null ? this.M.secDR : 0;
  }

  get userDRAction(): string {
    return this.M.userDRAction;
  }

  get enableOrgDR(): boolean {
    return this.M.enableOrgDR != null ? this.M.enableOrgDR : false;
  }

  get enableSecBC(): boolean {
    return this.M.enableSecBC != null ? this.M.enableSecBC : false;
  }

  get enableSecDR(): boolean {
    return this.M.enableSecDR != null ? this.M.enableSecDR : false;
  }

  get enableUserDR(): boolean {
    return this.M.enableUserDR != null ? this.M.enableUserDR : false;
  }
  get cls(): string {
    return 'PSMDAjaxControlHandlerImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._97) return true;
    return super.instanceof(cls);
  }
}
